<?php
/**
 * Created by PhpStorm.
 * User: 王松
 * Time: 2017/6/20 09:26
 */

namespace App\Transformers;

use App\Models\PastHistory;
use League\Fractal\TransformerAbstract;

class PastHistoryTransformer extends TransformerAbstract
{
    public function transform(PastHistory $history)
    {
        return [
            'id'                    => $history->id,
            'record_id'             => $history->record_id,
            'fat'                   => $history->fat,
            'hypertension'          => $history->hypertension,
            'coronary_disease'      => $history->coronary_disease,
            'hyperuricemia'         => $history->hyperuricemia,
            'hyperlipidemia'        => $history->hyperlipidemia,
            'fatty_liver'           => $history->fatty_liver,
            'hepatitis'             => $history->hepatitis,
            'pancreatitis'          => $history->pancreatitis,
            'pancreatic_operation'  => $history->pancreatic_operation,
            'renal'                 => $history->renal,
            'cerebral_infarction'   => $history->cerebral_infarction,
            'pcos'                  => $history->pcos,
            'transfusion'           => $history->transfusion,
            'irritability'          => $history->irritability,
            'special_irritability'  => $history->special_irritability,
            'adverse_drug_reaction' => $history->adverse_drug_reaction,
            'thyroid'               => $history->thyroid,
            'contagion'             => $history->contagion,
            'trauma'                => $history->trauma,
            'extra'                 => $history->extra,
            'medication'            => $history->medication,
            'other'                 => $history->other,
            'operation'             => $history->operation,
            'remark'                => $history->remark,
        ];
    }
}